package com.itheima.springsecureity_demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.springsecureity_demo.pojo.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT \n" +
            "t1.role_desc\n" +
            "FROM\n" +
            "  `ss_role` t1,\n" +
            "  `ss_role_user` t2,\n" +
            "  `ss_user` t3 \n" +
            "WHERE t1.role_id = t2.role_id \n" +
            "  AND t2.user_id = t3.user_id\n" +
            "and t3.user_name=#{username}")
    List<String> selectRoles(String username);
}
